<!--conf
<sample>
              <product version="2.6" edition="std"/>
                     <modifications>
                            <modified date="100609"/>
                     </modifications>
               </sample>
 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>Adding</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
	
	<script src="../common/testdata.js"></script>
	<script>

	
	var barChart1;
	
	window.onload = function(){
	 	barChart1 =  new dhtmlXChart({
            view:"bar",
            container:"chartDiv",
            value:"#sales#",
            label:"#sales#",
            gradient:"rising",
            width:50,
            radius:2,
            tooltip:{
                template:"#sales#"
            },
            yAxis:{
                start:0,
                end:100,
                step:10,
                template:function(value){
                    return value%20?"":value
                }
            },
            xAxis:{
                template:"'#year#"
            }

        });
        barChart1.parse(dataset,"json");
	};
	
	var counter = 12;
	function addNew () {
		barChart1.add({
			year:counter,
			sales:parseInt(Math.random()*100,10)
		});
		counter++;
	}
	function deleteFirst(){
		barChart1.remove(barChart1.first());
	}
	</script>
</head>
<body>
	<div id="chartDiv" style="width:800px;height:250px;border:1px solid #A4BED4;"></div>
	

	<input type="button" value="add" onclick="addNew()">
	<input type="button" value="delete" onclick="deleteFirst()">
</body>
</html>
